#ifndef __EEPROM_DRIVER_H__
#define __EEPROM_DRIVER_H__

#include "common.h"

/* EEPROM device address */
#define EEPROM_DEVICE_ADDR 0x50

/* EEPROM parameters */
#define EEPROM_PAGE_SIZE 32
#define EEPROM_TOTAL_SIZE 4096
#define EEPROM_WRITE_DELAY 5

/* Function declarations */
rt_err_t eeprom_init(void);
rt_err_t eeprom_read(uint16_t addr, uint8_t *data, uint16_t len);
rt_err_t eeprom_write(uint16_t addr, uint8_t *data, uint16_t len);
rt_err_t eeprom_save_config(void *config, uint16_t size);
rt_err_t eeprom_load_config(void *config, uint16_t size);
rt_bool_t eeprom_verify_data(uint8_t *data1, uint8_t *data2, uint16_t len);
uint16_t eeprom_calculate_crc(uint8_t *data, uint16_t len);

#endif /* __EEPROM_DRIVER_H__ */